<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<%@ page import="com.scalar.chiptrack.commons.Constants" %>

<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/chiptrack-tags.tld" prefix="chiptrack" %>
<%@ taglib uri="/WEB-INF/struts-nested.tld" prefix="nested" %>

<chiptrack:checkLogon sourcePage="/inventoryps.do"/>
<%
	String chipTracContext = "/" + ConfigManager.getChipTracContext();
    String userTypeChiptrac = Constants.USER_TYPE_CHIPTRAC + "";
%>
<html:html locale="true">

<HTML><HEAD><TITLE>Scalarsoft - ChipTrac</TITLE>
<META http-equiv=Content-Type content="text/html; charset=windows-1252">
<LINK href="<%=chipTracContext%>/jsp/includes/stylesheets/scalarsoft.css" type="text/css" rel="stylesheet">
<script src="<%=chipTracContext%>/jsp/includes/scripts/functions.js"></script>
<script src="<%=chipTracContext%>/jsp/includes/scripts/validations.js"></script>
<script src="<%=chipTracContext%>/jsp/includes/scripts/quickSearch.js"></script>
<META content="MSHTML 5.50.4807.2300" name=GENERATOR></HEAD>
<BODY bgColor=#ffffff leftMargin=0 topMargin=0 marginheight="0" marginwidth="0">

<script language="javascript">


function confirm()
{
    var pa=document.getElementById("message");
    pa.innerHTML                = '';

    var form                    = document.inventoryPackingSlipForm;

    for( var i=0; i < listSize; i++ )
    {
        form['selectedLotsList['+i+'].checked'].disabled = false; 
    }

    form.action.value = "confirm";
    form.submit();
}

function edit()
{
    var form            = document.inventoryPackingSlipForm;
    form.action.value   = "modify";
    form.submit();
}

function printablePackingSlip(packingSlipId)
{

    var packingSlipViewURL = '<%=chipTracContext%>/inventoryps.do?action=printView&packingSlipId=' + packingSlipId;
    newWindow = window.open (packingSlipViewURL,'optionsPopup','channelmode=no,directories=no,toolbar=no,menubar=no,personalbar=no,status=no,scrollbars=yes,resizable=yes');
    newWindow.focus();
}

function generatePDF(packingSlipId)
{
    var generatePDFURL = '<%=chipTracContext%>/inventoryps.do?action=generatePDF&packingSlipId=' + packingSlipId;
    newWindow = window.open (generatePDFURL,'generatePDFPopup','channelmode=no,directories=no,toolbar=no,menubar=no,personalbar=no,status=no,scrollbars=yes,resizable=yes');
    newWindow.focus();
}

</script>
<!-- Top Header Start-->
<logic:equal value="<%=userTypeChiptrac%>" name="user" property="userType" scope="session">
	<%@ include file="/jsp/includes/header.jsp" %>
</logic:equal>
<logic:notEqual value="<%=userTypeChiptrac%>" name="user" property="userType" scope="session">
	<%@ include file="/jsp/includes/extHeader.jsp" %>
</logic:notEqual>
<!-- Top Header End-->
<TABLE cellSpacing=0 cellPadding=0 width="100%">
	<TBODY>
	<TR>
		<td width='180' valign='top' background='<%=chipTracContext%>/jsp/includes/images/left_red_bg.gif'>
		<!-- Side Navigation start -->
	    <logic:equal value="<%=userTypeChiptrac%>" name="user" property="userType" scope="session">
		    <%@ include file="/jsp/operations/dataentryMenu.jsp" %>
		</logic:equal>
		<logic:notEqual value="<%=userTypeChiptrac%>" name="user" property="userType" scope="session">
			<%@ include file="/jsp/operations/ext_user_dataentryMenu.jsp" %>
		</logic:notEqual>
		<!-- end of the side navigations -->
		<TD bgcolor="#ffffff"><IMG height=9 src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" width=8></TD>
		<TD bgcolor="#ffffff"><IMG height=480 src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" width=2></TD>
		<TD valign="top" width="100%"  align=center>
			<IMG height=1 src="<%=chipTracContext%>/jsp/includes/images/clear.gif" width=500 border=0>
			<BR>

			<html:form name="inventoryPackingSlipForm" method = "POST"  type="com.scalar.chiptrack.operations.inventoryps.forms.InventoryPackingSlipForm" action="/inventoryps" >
			<input type="hidden" name="action" value="<%= (String)request.getAttribute("action")%>">
			<TABLE width="100%" align=center>
                <logic:notEqual value="view" name="action">
				<tr>
				   <td align = "left" colspan ="6">
						<a href="javascript:confirm()" onmouseover="window.status='Click here save Inventory Packing Slip';return true" onmouseout="window.status='';return true" title="Click here to save Inventory Packing Slip"><img border="0" src="<%=chipTracContext%>/jsp/includes/images/confirm.gif" width="75" height="17"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
						<a href="javascript:edit()" onmouseover="window.status='Click here to Edit Inventory Packing Slip';return true" onmouseout="window.status='';return true" title="Click here to Edit Inventory Packing Slip"><img border="0" src="<%=chipTracContext%>/jsp/includes/images/edit.gif" width="53" height="17"></a>
					</td>
				</tr>
                <TR><TD colspan=6 class="NArialW" align="center">Inventory Packing Slip Confirm</TD></TR>    
                </logic:notEqual>

                <logic:equal value="view" name="action">
                <TR><TD colspan=6 class="NArialW" align="center">Inventory Packing Slip View</TD></TR>
				<%--<TR><TD colspan=6 class="NArialL" align="center"><a href="javascript:printablePackingSlip(<bean:write property='packingSlipId' name='inventoryPackingSlipForm'/> );" onMouseOver="window.status='Printer-Friendly Version';return true" onMouseOut="window.status='';return true"><img src='<%=chipTracContext%>/jsp/includes/images/spacer.gif' border='0' height='1' width='1'><b>[Printer-Friendly Version]</b></a>&nbsp;&nbsp;</TD></TR>--%>
				<TR><TD colspan=6 class="NArialL" align="center"><a href="javascript:generatePDF(<bean:write property='packingSlipId' name='inventoryPackingSlipForm'/> );" onMouseOver="window.status='Printer-Friendly Version';return true" onMouseOut="window.status='';return true"><img src='<%=chipTracContext%>/jsp/includes/images/spacer.gif' border='0' height='1' width='1'><b>[Printer-Friendly Version]</b></a>&nbsp;&nbsp;</TD></TR>
                </logic:equal>
				<TR><TD colspan=6>&nbsp;</TD></TR>
							<TR><TD colspan=6 class='NArialL'><strong><FONT id="message" styleClass="NArialL" color='FF0000'></FONT></strong></TD></TR>
				<TR><TD colspan=6>
				<chiptrack:info  styleClass="NArialL" />
				<chiptrack:errors styleClass="NArialL" />
				<chiptrack:messages type="info" styleClass="NArialL" />
				</TD>
				</TR>
				<logic:equal name="showMessage" value="TRUE">
						<tr><td colspan=6 align='left'><font class='NArialS'color='blue'><b><%=Constants.NO_MODIFY_RIGHTS %></b></font></TD></TR>
				</logic:equal>

			<TR>
				<TD>
					<TABLE  border="0" width="100%" cellpadding="1" cellspacing="1" align=center>
						<tr>
							<td colspan="6"  class="NArialL"><FONT id="errors" color="FF0000"></FONT></td>
						</tr>
						<tr>
							<td width="21%"><font class="NArialL">PackingSlip Number:</font></td>
							<td width="21%" class='NArialL'>
								<bean:write name="inventoryPackingSlipForm" property="packingSlipNumber"/>
								<html:hidden name="inventoryPackingSlipForm"  property="packingSlipNumber"/>
								<html:hidden name="inventoryPackingSlipForm"  property="packingSlipId"/></td>
							<td width="3%">&nbsp;</td>
							<td width="21%">&nbsp;</td>
							<td width="21%">&nbsp;</td>
							<td width="3%">&nbsp;</td>
						</tr>
						<tr>
							<td width="21%"><font class="NArialL">From Location:</font></td>
							<td width="21%" class='NArialL'><bean:write name="inventoryPackingSlipForm" property="fromVendorName"/></td>
							<html:hidden name="inventoryPackingSlipForm"  property="locationId"/>
							<td width="3%">&nbsp;</td>
							<td width="21%"><font class="NArialL">To Location:</font></td>
							<td width="21%" class='NArialL'><bean:write name="inventoryPackingSlipForm" property="toVendorName"/></td>
							<html:hidden name="inventoryPackingSlipForm"  property="toVendorId"/>
							<td width="3%">&nbsp;</td>
						</tr>
						<tr>
							<td width="21%"><font class="NArialL">From Address:</font></td>
							<td width="21%" class='NArialL'>
											<bean:write name="inventoryPackingSlipForm" property="formattedFromAddress" filter="false"/>
							</td>
							<td width="3%">&nbsp;</td>
							<td width="21%"><font class="NArialL">To Address:</font></td>
							<td width="21%" class='NArialL'><bean:write name="inventoryPackingSlipForm" property="formattedToAddress" filter="false"/></td>
							<td width="3%">&nbsp;</td>
						</tr>
						<tr>
							<td width="21%"><font class="NArialL">No of boxes:</font></td>
							<td width="21%" class='NArialL'><bean:write name="inventoryPackingSlipForm" property="noOfBoxes"/>
							<html:hidden name="inventoryPackingSlipForm" property="noOfBoxes"/></td>
							<td width="3%">&nbsp;</td>
							<td width="21%"><font class="NArialL">Gross Weight:</font></td>
							<td width="21%" class='NArialL'><bean:write name="inventoryPackingSlipForm" property="grossWeight"/>
							<html:hidden name="inventoryPackingSlipForm" property="grossWeight"/><font class="NArialL"> Lbs</font></td>
							<td width="3%">&nbsp;</td>
						</tr>
						<tr>
							<td width="21%"><font class="NArialL">Ship Date:</font></td>
							<td width="21%" class='NArialL'><bean:write name="inventoryPackingSlipForm" property="shipDate"/>
								<html:hidden name="inventoryPackingSlipForm" property="shipDate"/>
							</td>
							<td width="3%">&nbsp;</td>
							<td width="21%"><font class="NArialL">Waybill No:</font></td>
							<td width="21%" class='NArialL'><bean:write name="inventoryPackingSlipForm" property="wayBillNo"/>
							<html:hidden name="inventoryPackingSlipForm" property="wayBillNo"/></td>
							<td width="3%">&nbsp;</td>
						</tr>
                        <TR>
                            <TD COLSPAN="6"><IMG SRC="<%=chipTracContext%>/jsp/includes/images/spacer.gif" HEIGHT=5></TD>
                        </TR>

                        <tr>
                            <td width="21%" class="NArialL">Special Instructions:</td>
							<td colspan="5" class="NArialL"><bean:write property="splInstructions" name="inventoryPackingSlipForm"/>
                            <html:hidden name="inventoryPackingSlipForm" property="splInstructions"/></td>
						</tr>
					</TABLE>
				</TD>
			</TR>
			<TR>
				<TD>
						<table width="100%" align="left" cellpadding="2" cellspacing="2" border="0">
							 <TR>
								<TD COLSPAN="9"><IMG SRC="<%=chipTracContext%>/jsp/includes/images/spacer.gif" HEIGHT=20></TD>
							</TR>

							<TR bgcolor="#993333" align = "left">
								<td class='NArialL' nowrap colspan="9"><font color="#FFFFFF">Lot Information</font></td>
							</TR>
							<nested:present property="selectedLotsList">
							<nested:size id="LotsSize" property="availableLotsList"/>
							<tr bgcolor="#993333" align = "center">
								<td class='NArialL'><font color="#FFFFFF">Select </font></td>
								<td class='NArialL' nowrap><font color="#FFFFFF">Part Number</font></td>
								<td class='NArialL' nowrap><font color="#FFFFFF">Lot No#</font></td>
								<td class='NArialL' nowrap><font color="#FFFFFF">FabLot No#</font></td>
								<td class='NArialL'><font color="#FFFFFF">Vendor</font></td>
								<td class='NArialL'><font color="#FFFFFF">Date In</font></td>
                                <td class='NArialL'><font color="#FFFFFF">Qty In</font></td>

								<logic:equal name="showWaferIds" value="TRUE">
									<td class='NArialL'><font color="#FFFFFF">Wafer Ids</font></td>
								</logic:equal>
								<td class='NArialL'><font color="#FFFFFF">Ship Qty </font></td>
							</tr>
						    <nested:size id="listSize" property="selectedLotsList"/>
							<nested:iterate id="lotDetails" property="selectedLotsList" indexId="iterateIdx" type = "com.scalar.chiptrack.operations.dataentry.LotDetails">

							<tr bgcolor='<%=iterateIdx.intValue() % 2 == 0 ? "#FFFFEE" : "#DEE1E2"%>'>
					             
								<td width ="3%" align="center" class='NArialL' ><nested:checkbox  name="lotDetails" property ="checked" disabled="true"/></td>
								<td class='NArialL'><nested:write name="lotDetails" property ="partNumber"/></td>
								<td class='NArialL'><nested:write name="lotDetails" property ="lotNumber"/></td>
								<td class='NArialL'><nested:write name="lotDetails" property ="fabLotNumber"/></td>
								<td class='NArialL'><nested:write name="lotDetails" property ="vendorName"/></td>
								<td class='NArialL'><nested:write name="lotDetails" property ="dateIn"/></td>
							<logic:equal name="showWaferIds" value="TRUE">
                                <logic:notEqual value="Die Bank" property="processType" name="inventoryPackingSlipForm">
								<td class='NArialL'><nested:write name="lotDetails" property ="waferQtyIn"/></td>
									<nested:hidden name="lotDetails" property ="waferQtyIn"/>
                                </logic:notEqual>
                                <logic:equal value="Die Bank" property="processType" name="inventoryPackingSlipForm">
                                 <td class='NArialL'><nested:write name="lotDetails" property ="dieQtyIn"/></td>
									<nested:hidden name="lotDetails" property ="dieQtyIn"/>
                                         <nested:hidden name="lotDetails" property="binQtyAsString"/>
                                        <nested:hidden name="lotDetails" property="checkedBinQtyAsString"/>
                                        <nested:hidden name="lotDetails" property="waferChecked"/>   
                                </logic:equal>
							</logic:equal>
							<logic:notEqual name="showWaferIds" value="TRUE">
                                <td class='NArialL'><nested:write name="lotDetails" property ="dieQtyIn"/></td>
								<nested:hidden name="lotDetails" property ="dieQtyIn"/>
                            </logic:notEqual>

							<logic:equal name="showWaferIds" value="TRUE">
								<td class='NArialL'><nested:write name="lotDetails"  property ="checkedWaferIdsAsString" /></td>
								<nested:hidden name="lotDetails" property ="waferIds"/>
								<nested:hidden name="lotDetails" property="checkedWaferIdsAsString"/>
							</logic:equal>
							<td class='NArialL'><nested:write name="lotDetails" property="shipQty"/>
							    <nested:hidden  name="lotDetails"  property="shipQty"/>
							</td>
							<nested:hidden property="processStepId"/>
							<nested:hidden property="lotId"/>
						</tr>
						</nested:iterate>
						<script type="text/javascript">
						   listSize = <%=listSize.intValue()%>;
						</script>
						</nested:present>
						 <TR>
							<TD COLSPAN="13"><IMG SRC="<%=chipTracContext%>/jsp/includes/images/spacer.gif" HEIGHT=20></TD>
						</TR>
						</table>
					</TD>
				</TR>
                </TABLE>
		</html:form>
		<BR><BR><BR>

		</TD>
		<TD bgcolor="#ffffff"><IMG height=1 src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" width=1></TD>
	</TR>
</TABLE>

<!-- Footer starts here -->
<%@ include file="/jsp/includes/footer.jsp" %>
<!-- footer end here -->
</BODY>
</html:html>
